/*
 *	xmath.c
 *	  part of the xlibrary by SunDEV (http://sundev.890m.com)
 *
 *	Changelog :
 *	  ##-##-## : First public release
 *
 */

#include <stdlib.h>
#include <stdio.h>
#include "xcommon.h"

#include "xmath.h"

u32 xgcd(u32 num1, u32 num2) {  // greatest common denominator
    unsigned long tmp;

    while (num2) {
        tmp=num2;
        num2=num1%num2;
        num1=tmp;
    }

    return num1;
}

